package com.itheima.controller;

import com.itheima.common.R;
import com.itheima.dto.EmpLoginDto;
import com.itheima.service.EmpService;
import com.itheima.vo.LoginVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController

public class LoginController {
    @Autowired
    private EmpService empService;
    @PostMapping("/login")
    public R Login(@RequestBody EmpLoginDto empLoginDto){
        LoginVo login =  empService.login(empLoginDto);
        return R.ok(login);
    }
}
